Skip to content

chore: bump minimum Go from 1.24 to 1.25#354

Merged
erraggy merged 2 commits intomainfrom
chore/bump-go-1.25
Mar 21, 2026
Merged

chore: bump minimum Go from 1.24 to 1.25#354
erraggy merged 2 commits intomainfrom
chore/bump-go-1.25

Conversation

@erraggy
Copy link
Copy Markdown
Owner

@erraggy erraggy commented Mar 21, 2026

Summary

  • 🧹 Remove GOEXPERIMENT=synctest from Makefile and all CI workflows (testing/synctest is GA in Go 1.25)
  • 📌 Update Makefile SDK pinning from go1.24.13go1.25.8, add tidy/fmt to QUALITY_TARGETS
  • ⬆️ Bump go-version from 1.241.25 in all 5 GitHub Actions workflows
  • 🔧 Replace deprecated goparser.ParseDir with os.ReadDir + goparser.ParseFile in internal/doctest/ (deprecated in Go 1.25, SA1019)
  • 📝 Update all docs, examples, and agent configs to "Requires Go 1.25+"
  • ✅ Preserve "Go 1.24+" attribution on b.Loop() benchmark references (feature was introduced in 1.24)

Go 1.25 improvements we get for free

  • Container-aware GOMAXPROCS on Linux (cgroup CPU limits respected automatically)
  • Stack-allocated slice backing arrays — compiler is more aggressive, benefiting parser/validator/walker
  • Two new go vet analyzers (waitgroup, hostport) — both clean in this codebase
  • Nil-check bug fix from Go 1.21–1.24 — all tests pass

Test plan

  • make check passes (8501 tests, 0 errors)
  • No remaining incorrect 1.24 references (verified with grep)
  • Benchmark b.Loop() references preserved as "Go 1.24+"
  • No deprecated API warnings from staticcheck/golangci-lint
  • CI workflows pass with Go 1.25

🤖 Generated with Claude Code

- Remove GOEXPERIMENT=synctest (GA in Go 1.25)
- Update SDK pinning from go1.24.13 to go1.25.8
- Add tidy/fmt to QUALITY_TARGETS for consistent SDK usage
- Bump go-version in all CI workflows to 1.25
- Replace deprecated goparser.ParseDir with os.ReadDir + ParseFile
- Update all docs/examples to require Go 1.25+
- Preserve "Go 1.24+" attribution on b.Loop() benchmark references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9d2eade8-01f6-4fa8-b160-7ef27fc3b11e

📥 Commits

Reviewing files that changed from the base of the PR and between c69f5eb and 766d182.

📒 Files selected for processing (1)
  • internal/mcpserver/input_test.go

📝 Walkthrough

Walkthrough

Upgrades the repository and examples from Go 1.24 → 1.25 (various docs, go.mod files, CI workflows, Makefile). Removes workflow/workspace GOEXPERIMENT=synctest usage. Adjusts internal tests to parse Go files per-file (ParseFile via os.ReadDir) and replaces synctest.Run calls with synctest.Test in three tests.

Changes

Cohort / File(s) Summary
CI / Workflows
.github/CONFIGURATION.md, .github/copilot-instructions.md, .github/workflows/benchmark.yml, .github/workflows/go-race.yml, .github/workflows/go.yml, .github/workflows/golangci-lint.yml, .github/workflows/release.yml
Updated Go toolchain pin from 1.24 → 1.25; removed GOEXPERIMENT: synctest env in some workflows; adjusted copilot/lint/benchmark guidance to reference Go 1.25.
Top-level docs & guides
README.md, AGENTS.md, CLAUDE.md, CONTRIBUTORS.md, benchmarks.md, docs/index.md, docs/claude-code-plugin.md, docs/mcp-server.md, docs/whitepaper.md, plugin/CLAUDE.md
Bumped documented minimum Go requirement from 1.24+ → 1.25+; removed GOEXPERIMENT=synctest guidance where noted.
Makefile / Build config
Makefile
Pinned SDK path updated to $(HOME)/sdk/go1.25.8; removed exporting GOEXPERIMENT; adjusted QUALITY_TARGETS and conditional gating to GO_SDK.
Main module & deps
go.mod
Set go 1.25.8, removed old toolchain pin; bumped several dependencies (e.g., modelcontextprotocol/go-sdk, golang.org/x/*, github.com/segmentio/encoding).
Examples — READMEs
examples/*/**/README.md (multiple)
Updated example prerequisites to require Go 1.25+.
Examples — go.mod files
examples/*/**/go.mod (multiple; compacted)
Updated go directive from 1.24.01.25.8; selected examples bumped indirect golang.org/x/* deps to newer minor versions.
Generator & test fixtures
generator/compile_test.go
Test fixture go.mod content updated to use Go 1.25 for compile tests.
Internal doctest helpers
internal/doctest/doc_api_sync_test.go, internal/doctest/doc_test.go
Switched parsing from package-level ParseDir → per-file os.ReadDir + go/parser.ParseFile; updated error handling and filename filtering.
Internal tests (synctest harness)
internal/mcpserver/input_test.go
Replaced synctest.Run(func(){...}) with synctest.Test(t, func(t *testing.T){...}) in three tests to use the new test harness form.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'chore: bump minimum Go from 1.24 to 1.25' clearly and concisely summarizes the main change: updating the project's minimum Go version requirement.
Description check ✅ Passed The pull request description is comprehensive and directly related to the changeset, detailing the removal of GOEXPERIMENT=synctest, SDK version updates, workflow changes, and documentation updates—all present in the actual changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-go-1.25

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
internal/doctest/doc_api_sync_test.go (1)

231-266: 🧹 Nitpick | 🔵 Trivial

Refactor addresses SA1019 correctly; minor variable shadowing to consider.

The per-file parsing approach properly replaces the deprecated goparser.ParseDir. However, name at line 257 shadows the outer name variable (line 236) which holds the filename. While this doesn't cause a functional bug since the filename isn't used after this point, it can trigger linter warnings and cause confusion.

♻️ Suggested rename for clarity
 				case *ast.ValueSpec:
-					for _, name := range s.Names {
-						if name.IsExported() {
-							syms[name.Name] = true
+					for _, ident := range s.Names {
+						if ident.IsExported() {
+							syms[ident.Name] = true
 						}
 					}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/doctest/doc_api_sync_test.go` around lines 231 - 266, The variable
name used for the file name (assigned as name in the entries loop and used in
ParseFile/error messages) is shadowed by the inner loop variable "name" in the
ValueSpec loop; rename the inner loop variable (e.g., to ident or valName) in
the for _, name := range s.Names loop so it no longer shadows the file-level
name, keeping references to the file name (ParseFile and require.NoError
message) unchanged; update any usages inside that inner loop to use the new
identifier (e.g., ident.Name) instead.
.github/workflows/release.yml (1)

8-10: ⚠️ Potential issue | 🟠 Major

Reduce default workflow token scope to least privilege.
Set permissions: contents: read at the top level. The current contents: write is overly broad—actions/checkout@v6 requires only read access, and goreleaser-action uses a custom PAT (secrets.HOMEBREW_TAP_TOKEN) that bypasses the default token's permissions entirely. Grant write only if truly required at the job or step level, following principle of least privilege (CWE-275).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 8 - 10, Top-level workflow
permissions are too permissive: change the top-level permissions entry from
contents: write to contents: read, and if any job or step truly needs write,
grant contents: write only on that specific job/step; reference the top-level
permissions block and the steps using actions/checkout@v6 and goreleaser-action
(which should rely on secrets.HOMEBREW_TAP_TOKEN) to scope the write permission
down to where the custom PAT is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/workflows/collision-resolution/go.mod`:
- Line 3: Update the go directive in the module file to remove the
patch/toolchain patch version: replace the current `go` directive value `1.25.8`
with the language version `1.25` (i.e., change the `go` directive in the go.mod
to `go 1.25`) so the file uses the proper Go language version syntax rather than
a patched toolchain number; if you need to pin a specific toolchain, use a
separate `toolchain` directive instead.

In `@generator/compile_test.go`:
- Around line 90-96: Multiple test helpers create duplicate inline go.mod
content via the goModContent variable; centralize this into a single constant or
helper to prevent version drift. Replace repeated inline goModContent usages
with a shared constant (e.g., testGoModTemplate) or a helper function (e.g.,
WriteTestGoMod(outputDir, goVersion)) and update callers that currently set
goModContent and call os.WriteFile to use that helper/constant instead (refer to
the goModContent occurrences in compile_test.go). Ensure the helper writes the
same file permissions and retains the go version placeholder so version bumps
happen in one place.

In `@Makefile`:
- Around line 12-15: Add a Makefile preflight that fails fast when the
configured Go toolchain is missing or older than 1.25: in the block that
currently uses GO_SDK and QUALITY_TARGETS, add a check (using GO_SDK or `go
version` when GO_SDK is unset) to parse the Go major.minor version and abort
with a clear error if it is less than 1.25 (or if GO_SDK path like
$(HOME)/sdk/go1.25.8 is missing), so running the QUALITY_TARGETS (e.g.
check/lint/test) cannot proceed on an unsupported Go version; reference the
existing GO_SDK and QUALITY_TARGETS symbols when implementing the check so it
gates the same targets.

---

Outside diff comments:
In @.github/workflows/release.yml:
- Around line 8-10: Top-level workflow permissions are too permissive: change
the top-level permissions entry from contents: write to contents: read, and if
any job or step truly needs write, grant contents: write only on that specific
job/step; reference the top-level permissions block and the steps using
actions/checkout@v6 and goreleaser-action (which should rely on
secrets.HOMEBREW_TAP_TOKEN) to scope the write permission down to where the
custom PAT is used.

In `@internal/doctest/doc_api_sync_test.go`:
- Around line 231-266: The variable name used for the file name (assigned as
name in the entries loop and used in ParseFile/error messages) is shadowed by
the inner loop variable "name" in the ValueSpec loop; rename the inner loop
variable (e.g., to ident or valName) in the for _, name := range s.Names loop so
it no longer shadows the file-level name, keeping references to the file name
(ParseFile and require.NoError message) unchanged; update any usages inside that
inner loop to use the new identifier (e.g., ident.Name) instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 427f509a-3fee-41b2-b618-c66191af3135

📥 Commits

Reviewing files that changed from the base of the PR and between 6203bab and c69f5eb.

⛔ Files ignored due to path filters (5)
  • examples/programmatic-api/builder/go.sum is excluded by !**/*.sum
  • examples/workflows/fixer-showcase/go.sum is excluded by !**/*.sum
  • examples/workflows/pipeline-compositions/go.sum is excluded by !**/*.sum
  • examples/workflows/validate-and-fix/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (67)
  • .github/CONFIGURATION.md
  • .github/copilot-instructions.md
  • .github/workflows/benchmark.yml
  • .github/workflows/go-race.yml
  • .github/workflows/go.yml
  • .github/workflows/golangci-lint.yml
  • .github/workflows/release.yml
  • AGENTS.md
  • CLAUDE.md
  • CONTRIBUTORS.md
  • Makefile
  • README.md
  • benchmarks.md
  • docs/claude-code-plugin.md
  • docs/index.md
  • docs/mcp-server.md
  • docs/whitepaper.md
  • examples/petstore/README.md
  • examples/petstore/chi/go.mod
  • examples/petstore/stdlib/go.mod
  • examples/programmatic-api/builder/README.md
  • examples/programmatic-api/builder/go.mod
  • examples/quickstart/README.md
  • examples/quickstart/go.mod
  • examples/validation-pipeline/README.md
  • examples/validation-pipeline/go.mod
  • examples/walker/api-documentation/README.md
  • examples/walker/api-documentation/go.mod
  • examples/walker/api-statistics/README.md
  • examples/walker/api-statistics/go.mod
  • examples/walker/public-api-filter/README.md
  • examples/walker/public-api-filter/go.mod
  • examples/walker/reference-collector/README.md
  • examples/walker/reference-collector/go.mod
  • examples/walker/security-audit/README.md
  • examples/walker/security-audit/go.mod
  • examples/walker/vendor-extensions/README.md
  • examples/walker/vendor-extensions/go.mod
  • examples/workflows/breaking-change-detection/README.md
  • examples/workflows/breaking-change-detection/go.mod
  • examples/workflows/collision-resolution/README.md
  • examples/workflows/collision-resolution/go.mod
  • examples/workflows/fixer-showcase/README.md
  • examples/workflows/fixer-showcase/go.mod
  • examples/workflows/http-validation/README.md
  • examples/workflows/http-validation/go.mod
  • examples/workflows/multi-api-merge/README.md
  • examples/workflows/multi-api-merge/go.mod
  • examples/workflows/overlay-transformations/README.md
  • examples/workflows/overlay-transformations/go.mod
  • examples/workflows/pipeline-compositions/README.md
  • examples/workflows/pipeline-compositions/go.mod
  • examples/workflows/schema-deduplication/README.md
  • examples/workflows/schema-deduplication/go.mod
  • examples/workflows/schema-renaming/README.md
  • examples/workflows/schema-renaming/go.mod
  • examples/workflows/validate-and-fix/README.md
  • examples/workflows/validate-and-fix/go.mod
  • examples/workflows/version-conversion/README.md
  • examples/workflows/version-conversion/go.mod
  • examples/workflows/version-migration/README.md
  • examples/workflows/version-migration/go.mod
  • generator/compile_test.go
  • go.mod
  • internal/doctest/doc_api_sync_test.go
  • internal/doctest/doc_test.go
  • plugin/CLAUDE.md

Comment thread examples/workflows/collision-resolution/go.mod
Comment thread generator/compile_test.go
Comment thread Makefile
In Go 1.25, synctest.Run was renamed to synctest.Test(t, func(t *testing.T)).
The old Run function only exists behind GOEXPERIMENT=synctest as a migration
bridge and will be removed in Go 1.26.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.77%. Comparing base (6203bab) to head (766d182).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #354   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         194      194           
  Lines       27246    27246           
=======================================
  Hits        23097    23097           
  Misses       2829     2829           
  Partials     1320     1320           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erraggy erraggy merged commit 7fd7ffb into main Mar 21, 2026
20 checks passed
@erraggy erraggy deleted the chore/bump-go-1.25 branch March 21, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant